package scu.maqiang.possion;

import scu.maqiang.mesh.*;
import scu.maqiang.fes.*;

/**
 * 薄膜有限元计算程序
 */
public class Membrane {

	public static void main(String[] args) {
		long startTime = System.nanoTime();
		
		new Membrane().solveMembrane();
		
		long endTime = System.nanoTime();
		System.out.println("Elapse Time：" + (endTime - startTime) / 1e9 + " s");
	}
	
	public void solveMembrane() {
		Mesh2T3 mesh = new Mesh2T3().square2D(100, 100, T3Type.Left);
		//.readMesh("mesh2D\\membrane.msh", MeshFormat.msh);
		ScalarFunc kxxFunc = (xy, label, param) -> 1.0;
		ScalarFunc sourceFunc = (xy, label, param) -> 1.0;
		int[] bdLabel = {1, 2, 3, 4};
		ScalarFunc bdFunc = (xy, label, param) -> xy[0];
		Possion2DT31 p2dt31 = new Possion2DT31(mesh);
		p2dt31.DirichletProblem(BVPType.COMMON,
				                kxxFunc, null, 
				                sourceFunc, null, 
				                null, null, null,
				                "membrandSol.dat");
	}


}
